package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.CreditBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.CreditCardListContract;
import com.seveneight.baijiesteward.ui.user.model.CreditCardListModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/23.
 */

public class CreditCardListPresenter implements CreditCardListContract.CreditCardListPresenter {

    CreditCardListContract.CreditCardListView cardListView;
    CreditCardListContract.CreditCardListModel cardListModel;

    public CreditCardListPresenter(CreditCardListContract.CreditCardListView cardListView) {
        this.cardListView = cardListView;
        cardListModel = new CreditCardListModel();
    }

    @Override
    public void getCreditCardList(Context context, RequestBody body) {
        cardListModel.getCreditCardList(context,body, new MyCallBack<List<CreditBean>>() {
            @Override
            public void onSuccess(List<CreditBean> creditBeans) {
                cardListView.reBackCreditCardList(creditBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }

}
